<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: angdiff</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: angdiff</td>
      <td class="subheader-left"><a href="matlab:open angdiff">View code for angdiff</a></td>
    </tr>
  </table>
<h1>angdiff</h1><p><span class="helptopic">Difference of two angles</span></p><p>
<span style="color:red">angdiff</span>(<strong>th1</strong>, <strong>th2</strong>) is the difference between angles <strong>th1</strong> and <strong>th2</strong>
on the circle.  The result is in the interval [-pi pi).  Either or both
arguments can be a vector:

</p>
<ul>
  <li>If TH1 is a vector, and TH2 a scalar then return a vector where TH2 is modulo
subtracted from the corresponding elements of TH1.</li>
  <li>If TH1 is a scalar, and TH2 a vector then return a vector where the
corresponding elements of TH2 are modulo subtracted from TH1.</li>
  <li>If TH1 and TH2 are vectors then return a vector whose elements are the modulo
difference of the corresponding elements of TH1 and TH2.</li>
</ul>
<p>
<span style="color:red">angdiff</span>(<strong>th</strong>) as above but <strong>th</strong>=[<strong>th1</strong> <strong>th2</strong>].

</p>
<p>
<span style="color:red">angdiff</span>(<strong>th</strong>) is the equivalent angle to <strong>th</strong> in the interval [-pi pi).

</p>
<h2>Notes</h2>
<ul>
  <li>If TH1 and TH2 are both vectors they should have the same
orientation, which the output will assume.</li>
</ul>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>